package com.zpark.jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

/**
 * @PackageName: com.zpark.jsoup
 * @ClassName: Demo03
 * @Description: 使用Jsoup.parse()方法从字符串加载HTML。
 * @author: RZS
 * @date: 2021/8/15  23:14
 */
public class Demo03 {
    public static void main(String[] args) {
        String context = "<!doctype html>\n" +
                "<html>\n" +
                " <head> \n" +
                "  <meta charset=\"utf-8\"> \n" +
                "  <title></title> \n" +
                "  <script type=\"text/javascript\">\n" +
                "\t\t\tdocument.onkeyup = function(event){ \n" +
                "\t\t\t    \n" +
                "\t\t\t  var event = event || window.event; \n" +
                "\t\t\t  alert(\"按下的键盘keycode值为：\"+event.keyCode); \n" +
                "\t\t\t  console.log(event.keyCode);\n" +
                "\t\t\t}\n" +
                "\n" +
                "\t\t</script> \n" +
                " </head> \n" +
                " <body>   \n" +
                " </body>\n" +
                "</html>";
        Document document = Jsoup.parse(context);
        System.out.println(document);
    }
}
